﻿<UserControl x:Class="LiSAClient.WpfClient.View.Frame.UserInfo"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             mc:Ignorable="d"
             d:DesignHeight="75" d:DesignWidth="300" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,15,0,0">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>



        <Image Grid.Column="2" Grid.RowSpan="2" Grid.Row="0" Source="pack://application:,,,/LiSAClient.WpfClient;component/Resources/Media/Images/person-icon.png"  Margin="0,0,20,0" Height="30" />


        <Button HorizontalAlignment="Left" Grid.Row="0" Grid.RowSpan="2" Grid.Column="1" Style="{StaticResource UserActionsMenuStyle}"
                Name="UserActionsButton" VerticalAlignment="Top" Click="UserActionsButton_Click" >
            <Button.Content>
                <Label>▼</Label>
            </Button.Content>
            <Button.ContextMenu>
                <ContextMenu Style="{StaticResource UserActionsContextMenu}">
                    <MenuItem Style="{StaticResource UserMenuItemStyle}" Click="Profile_OnClick">
                        <MenuItem.Header>
                            <DockPanel>
                                <Label>User profile</Label>
                            </DockPanel>
                        </MenuItem.Header>
                    </MenuItem>
                    <MenuItem Style="{StaticResource UserMenuItemStyle}" Click="Setup_OnClick">
                        <MenuItem.Header>
                            <DockPanel>
                                <Label>User settings</Label>
                            </DockPanel>
                        </MenuItem.Header>
                    </MenuItem>
                    <MenuItem Style="{StaticResource UserMenuItemStyle}" Click="Logout_OnClick">
                        <MenuItem.Header>
                            <DockPanel>
                                <Label>Log off</Label>
                            </DockPanel>
                        </MenuItem.Header>
                    </MenuItem>
                </ContextMenu>
            </Button.ContextMenu>
        </Button>

        <TextBlock Grid.Row="0" Grid.Column="0" Name="TextBlockName" Text="{Binding CurrentUser.FullName}" Style="{StaticResource UserInfoNameStyle}"/>
        <TextBlock Grid.Row="1" Grid.Column="0" Name="TextBlockCompany"  Text="{Binding CurrentUser.Organization.Name}" Style="{StaticResource UserInfoOrganizationStyle}"  />
    </Grid>
</UserControl>
